﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Hdt.TransOcean.Presentation.UserControls
{
    public partial class HdtManageControl : UserControl
    {
        public HdtManageControl()
        {
            InitializeComponent();
        }

        public bool EnabledNewButton
        {
            get { return barButtonNew.Enabled; }
            set { barButtonNew.Enabled = value; }
        }
        public bool EnabledSaveButton
        {
            get { return barButtonSave.Enabled; }
            set { barButtonSave.Enabled = value; }
        }
        public bool EnabledEditButton
        {
            get { return barButtonEdit.Enabled; }
            set { barButtonEdit.Enabled = value; }
        }
        public bool EnabledCloseButton
        {
            get { return barButtonClose.Enabled; }
            set { barButtonClose.Enabled = value; }
        }
       
        

        public bool EnabledImportButton
        {
            get { return barButtonImport.Enabled; }
            set { barButtonImport.Enabled = value; }
        }

        public bool EnabledExportButton
        {
            get { return barButtonExport.Enabled; }
            set { barButtonExport.Enabled = value; }
        }

        public bool EnabledDeleteButton
        {
            get { return barButtonDelete.Enabled; }
            set { barButtonDelete.Enabled = value; }
        }

       

        public delegate void OnNewButtonClick();
        public delegate void OnSaveButtonClick();
        public delegate void OnCloseButtonClick();
        public delegate void OnEditButtonClick();
        public delegate void OnDeleteButtonClick();
        public delegate void OnImportButtonClick();
        public delegate void OnExportButtonClick();


        public event OnNewButtonClick HdtNewButtonClick;
        public event OnSaveButtonClick HdtSaveButtonClick;
        public event OnCloseButtonClick HdtCloseButtonClick;
        public event OnEditButtonClick HdtEditButtonClick;
        public event OnDeleteButtonClick HdtDeleteButtonClick;
        public event OnImportButtonClick HdtImportButtonClick;
        public event OnExportButtonClick HdtExportButtonClick;


        private void barButtonNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (HdtNewButtonClick != null)
                HdtNewButtonClick();
        }

        private void barButtonEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (HdtEditButtonClick != null)
                HdtEditButtonClick();
        }

        private void barButtonSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (HdtSaveButtonClick != null)
                HdtSaveButtonClick();
        }

        private void barButtonDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (HdtDeleteButtonClick != null)
                HdtDeleteButtonClick();
        }

        private void barButtonClose_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (HdtCloseButtonClick != null)
                HdtCloseButtonClick();
        }

        private void barButtonImport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (HdtImportButtonClick != null)
                HdtImportButtonClick();
        }

        private void barButtonExport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (HdtExportButtonClick != null)
                HdtExportButtonClick();
        }

    }
}
